package cn.com.pxto.web.tag;


import java.io.IOException;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;

import org.apache.struts.taglib.TagUtils;
import org.apache.struts.taglib.html.Constants;


@SuppressWarnings("serial")
public class DynaFormValueTag extends BodyTagSupport {
	private String property = null;

	public void setProperty(String property) {
		this.property = property;
	}
	
	public int doStartTag() throws JspException {
		//��DynamicForm�в�����Ӧ������ֵ
		Object value = TagUtils.getInstance().lookup(pageContext,Constants.BEAN_KEY,property,null);

		try {
			if (value==null){
				pageContext.getOut().print("");
			}else{
				pageContext.getOut().print(value.toString());
			}
		} catch (IOException e) {
			throw new JspException("Print Error:" + 
                    e.getMessage(  ));
		}
		return super.doStartTag();
	}

	
	
	
}
